package com.xmy.cultivate.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.xmy.cultivate.entity.PickUp;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;

import java.util.List;

/**
 * <p>
 * 家长接送信息 Mapper 接口
 * </p>
 *
 * @author hpiggy
 * @since 2023-04-27
 */
public interface PickUpMapper extends BaseMapper<PickUp> {

    @Select("SELECT teacher_id,school_id,teacher_name,school_name, COUNT(*) AS allNumber, COUNT(CASE WHEN pickup_type <> 0 THEN 1 END) AS pickUpNumber\n" +
            "FROM pick_up ${ew.customSqlSegment}")
    public IPage<PickUp> sumPickUp(IPage<?> page,@Param(Constants.WRAPPER)QueryWrapper queryWrapper);

}
